var acttool = require('../../sys/sys_addr.js')
module.exports = Behavior({
  behaviors: [],
  properties: {
    
  },
  data: {
    // myBehaviorData: {}
  },
  attached: function(){},
  ready: function () {
    
  },
  methods: {  
    
    getphone:function(e){
      console.log("ssssssssssssssssssssssssssssssssssss")   
      console.log(e)  
 
      var that = this;
 
      var encryptedData = e.detail.encryptedData;
      var iv = e.detail.iv;
      var code = e.detail.code;

      acttool.getphone(encryptedData, iv,code).then(function (data) {   
        console.log("dddddddddddddd")   
        console.log(data)   

        if (data["code"] == "success") {
          e.detail= data["obj"].phoneNumber;
          that.xvmodel(e)        
        }
      });
    }    ,
    xvmodel: function(e){
      var dataset =e.currentTarget.dataset       
      var upmodel={}
      upmodel[dataset.xfield]=e.detail

     
      this.setData(upmodel)
    }
  }
})